<template>
  <div class="Showcase1">
    <div class="Showcase1-top">
      <div
        class="ex-item"
        v-for="(item, index) in props.list"
        :key="index"
        :style="{
          left: `${ShowcaseItemTransform(item.x ? item.x : getParentX(index), item.width, 1.2855)}rem`,
        }"
      >
        <div
          class="name-box"
          :style="{ backgroundImage: `url(${publicUrls + 'free/style1/Showcase3bg1.png?imageView2/format/webp'})` }"
        >
          <div class="name-item">{{ item.name }}</div>
        </div>
      </div>
      <img
        class="Showcase1-top-left"
        :src="publicUrls + 'free/style1/Showcase3topleft.png?imageView2/format/webp'"
        alt=""
      />
      <div
        class="Showcase1-top-center"
        :style="{
          backgroundImage: `url(${publicUrls + 'free/style1/Showcase3topcenter.png?imageView2/format/webp'})`,
        }"
      ></div>
      <img
        class="Showcase1-top-right"
        :src="publicUrls + 'free/style1/Showcase3topright.png?imageView2/format/webp'"
        alt=""
      />
    </div>
    <div class="Showcase1-center">
      <img
        class="Showcase1-center-left"
        :src="publicUrls + 'free/style1/Showcase3cenLeft.png?imageView2/format/webp'"
        alt=""
      />
      <div class="Showcase1-center-center"></div>
      <img
        class="Showcase1-center-right"
        :src="publicUrls + 'free/style1/Showcase3cenRight.png?imageView2/format/webp'"
        alt=""
      />
    </div>
    <div class="Showcase1-btm">
      <img
        class="Showcase1-btm-left"
        :src="publicUrls + 'free/style1/Showcase3btmLeft.png?imageView2/format/webp'"
        alt=""
      />
      <div class="Showcase1-btm-center"></div>
      <img
        class="Showcase1-btm-right"
        :src="publicUrls + 'free/style1/Showcase3btmRight.png?imageView2/format/webp'"
        alt=""
      />
    </div>
  </div>
</template>  

<script lang="ts">
export default defineComponent({
  name: 'style2',
});
</script>
  
<script setup lang="ts">
import { publicUrls } from '@/utils/minxin';
import { ShowcaseItemTransform } from '@/utils/setmaterialStyle';
import { defineComponent } from 'vue';
const props = defineProps({
  list: {
    type: Object,
  },
});
const getParentX = (indexs: number) => {
  let x = 0;
  for (let index = 0; index < indexs; index++) {
    // const element = array[index];
    x = x + props.list[index].width;
  }

  return x + 0.3;
};
</script>  

<style scoped lang="less">
.Showcase1 {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  height: 98%;
}
.Showcase1-top {
  width: 100%;
  height: 111px;
  display: flex;
  .Showcase1-top-left {
    width: 207px;
    height: 100%;
  }
  .Showcase1-top-center {
    width: 100%;
    min-width: 192px;
    height: 100%;
    background-repeat: repeat;
    background-size: auto 100%;
  }
  .Showcase1-top-right {
    width: 197px;
    height: 100%;
  }
}
.ex-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  position: absolute;
  top: 65px;
  z-index: 10;
  .name-box {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 180px;
    height: 60px;
    background-size: 100% 100%;
    background-repeat: no-repeat;
    padding: 4px 13px;
    padding-top: 18px;
    .name-item {
      width: 234;
      height: 32px;
      font-size: 16px;
      font-weight: 400;
      line-height: 32px;
      text-align: center;
      overflow: hidden;
      text-overflow: ellipsis;
      white-space: nowrap;
      text-align: center;
      color: #fef3df;
    }
  }
}
.Showcase1-center {
  display: flex;
  width: 100%;
  height: 100%;
  min-height: 100px;
  .Showcase1-center-left {
    width: 207px;
    height: 100%;
    flex-shrink: 0;
  }
  .Showcase1-center-center {
    width: 100%;
    min-width: 192px;
  }
  .Showcase1-center-right {
    width: 197px;
    height: 100%;
    flex-shrink: 0;
  }
}
.Showcase1-btm {
  width: 100%;
  height: 90px;
  background-size: auto 100%;
  display: flex;
  .Showcase1-btm-left {
    width: 207px;
    height: 100%;
    flex-shrink: 0;
  }
  .Showcase1-btm-center {
    width: 100%;
    min-width: 192px;
  }
  .Showcase1-btm-right {
    width: 197px;
    height: 100%;
    flex-shrink: 0;
  }
}
</style>